package geppetto.phraseTable.builder;

import java.io.PrintStream;

import geppetto.cat.corpus.BilingualCorpus;
import geppetto.phraseHMM.WordTrie;
import geppetto.phraseTable.PrintSpecification;
import geppetto.phraseTable.phrase.Phrase;

public class MosesPhraseWriter extends PhraseWriter{

	PrintStream out;
	BilingualCorpus corpus;
	WordTrie sourcePhrases;
	WordTrie foreignPhrases;
	PrintSpecification spec;
	
	public MosesPhraseWriter(PrintStream out, BilingualCorpus corpus,
			WordTrie sourcePhrases, WordTrie foreignPhrases,
			PrintSpecification spec) {
		super();
		this.out = out;
		this.corpus = corpus;
		this.sourcePhrases = sourcePhrases;
		this.foreignPhrases = foreignPhrases;
		this.spec = spec;
	}

	@Override
	public void writePhrase(Phrase p) {
		out.println(p.stringMosesRep(corpus, sourcePhrases, foreignPhrases, spec));
	}

}
